UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '9Qo96KxW48kJlfCecKzcrVDfRLIy5P520VEPh4GwS6o='
WHERE
key_id = 'd1f3be836393cbc3e57a6b6e8f82fe8e57196416dd5a6b56a80412f14a7a7d35'
AND (
token = '9Qo96KxW48kJlfCecKzcrVDfRLIy5P520VEPh4GwS6o='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)