UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'SUaJR2zAskX6eQQGqDcjoE0THvPvlQE1pfXB/I7zqHQ='
WHERE
key_id = 'e4cb22e02cf9849581d42d1851d852ddc00905e1029987ae7c02d51ed7f9ff2b'
AND (
token = 'SUaJR2zAskX6eQQGqDcjoE0THvPvlQE1pfXB/I7zqHQ='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)