UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'mhXN41Lv+dewsvv2C50Jn4gkfhEU5voYGzi3IfjUE5U='
WHERE
key_id = '14fb2bec2518cc1170a8bc4961610b64b6855224e0ba2cd97637c68579375dea'
AND (
token = 'mhXN41Lv+dewsvv2C50Jn4gkfhEU5voYGzi3IfjUE5U='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)