UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '/FwFFdLri37/T0fikKBumYcHqHdvzXDDe7OPSvlleU8='
WHERE
key_id = '8a87d5273346cc20a963f57fc0b76e9319a31bf2f227f2c5e73f39988ee54076'
AND (
token = '/FwFFdLri37/T0fikKBumYcHqHdvzXDDe7OPSvlleU8='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)