UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'RdcoPyZENIaPCo40ynDNzJY/81KJW7ibr9j0UzdF9fA='
WHERE
key_id = '7caa31f02edd0b1ebdae9755cb68a967741a1304056c523ecb15afe646f16b78'
AND (
token = 'RdcoPyZENIaPCo40ynDNzJY/81KJW7ibr9j0UzdF9fA='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)