UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'ahxDeP3RtInYQYsvfZdbZ1hmwoPnaZxdw0zRblTpx1Y='
WHERE
key_id = 'a801c0ea286b9ff36bcbc50829780fcf0b77e2d099958706480c1f59cf086f54'
AND (
token = 'ahxDeP3RtInYQYsvfZdbZ1hmwoPnaZxdw0zRblTpx1Y='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)