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