UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'uHi2S3cHCzZiEkOSdFsYgf5O2E0JRT04YA2PkFc35Vw='
WHERE
key_id = 'f94aa68baa27f6ac28d9b0d67eaa02f0c2e40564e6717a9be6c65150a7d16868'
AND (
token = 'uHi2S3cHCzZiEkOSdFsYgf5O2E0JRT04YA2PkFc35Vw='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)