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