UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'si7jHlzgYlWWrFvPmQcGhKiTqS2fokxWC1Cc8MKxfn0='
WHERE
key_id = '3b32ce1a33298338a3494de3248134eeab34a69cbc26f28c8a91874d238b9ecf'
AND (
token = 'si7jHlzgYlWWrFvPmQcGhKiTqS2fokxWC1Cc8MKxfn0='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)