UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'q62/JzkntjqyKd4PdBeIoL3uI59Wn6QJ6B1wKAcvZpA='
WHERE
key_id = 'a0a525fe5a12ca25b9c64f4bc47d6e27fa7e42192b74538d81e45b0581df1b11'
AND (
token = 'q62/JzkntjqyKd4PdBeIoL3uI59Wn6QJ6B1wKAcvZpA='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)