UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '9Rw+6c1RsQQankSXB2yNKPH9o3iohKhEJejA4qcJt+k='
WHERE
key_id = 'dd404cb01e61089cd89ebfddcf084c0877d8fc49679b27b26bbd6195937ec077'
AND (
token = '9Rw+6c1RsQQankSXB2yNKPH9o3iohKhEJejA4qcJt+k='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)