UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'whW79NYejAzVdLoidbsnlrpx/XfHdOj3qV8S8gMfmQw='
WHERE
key_id = 'cee4af1dc26c4714f55aefb41ea774f3f14c7476eb1c4bcf870a64f75ef4f19a'
AND (
token = 'whW79NYejAzVdLoidbsnlrpx/XfHdOj3qV8S8gMfmQw='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)