UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'LkpUTCDsLetgYo9pMhsAMXHIiKOI2llUWvWGeR5WR6Q='
WHERE
key_id = '2f9404908ce58af01011c3199ed60dae21d0e9be703a9ad71af281a8c75da363'
AND (
token = 'LkpUTCDsLetgYo9pMhsAMXHIiKOI2llUWvWGeR5WR6Q='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)