UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '7NW5CrXEbB6rQz5xTrcLuKW2DFl5ykfAiF7l4L/xH4g='
WHERE
key_id = '06f7a67af8c0ba06bb61f2fc00aa2eed3d5e59b6f41577a32d139052d712e4b7'
AND (
token = '7NW5CrXEbB6rQz5xTrcLuKW2DFl5ykfAiF7l4L/xH4g='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)