UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '7TDV3eVTbqhEx3ZBwV7J1SJNxZDa6ZeCMm72wvEcmp0='
WHERE
key_id = '22e30e98aaaa6f5ad697e26916d2b3b6ecbd86eedfba2da93706bb9a82c7c5ba'
AND (
token = '7TDV3eVTbqhEx3ZBwV7J1SJNxZDa6ZeCMm72wvEcmp0='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)