UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 's7ItwEymRDB3lCPDusdUCeDUAKBmWYxqSV/exwA7YqI='
WHERE
key_id = '4c2020bae673efcf1d136430c156a7fac090eada4634b73ea8db240ca07b693c'
AND (
token = 's7ItwEymRDB3lCPDusdUCeDUAKBmWYxqSV/exwA7YqI='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)