UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '2AWuENkHXl81ax8o0z0FA/2oXV00Dc2Algbhky4CPT0='
WHERE
key_id = 'fb9aaee88172efdb255c90b62dc49e89b138d549e77bf6e3af14d9d6bc9ab18c'
AND (
token = '2AWuENkHXl81ax8o0z0FA/2oXV00Dc2Algbhky4CPT0='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)