UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'D1A/NF8gxUJPMG2Wp9/KxqD7vBwdBa6nFlL1pf/Dxz0='
WHERE
key_id = '1aea17b981d9f6bbbd0db0eaed937c7f579f1c5cc38f76fd0a663933022a7a57'
AND (
token = 'D1A/NF8gxUJPMG2Wp9/KxqD7vBwdBa6nFlL1pf/Dxz0='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)