UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'bsusKzEZLNujvpkrwGHv3nRcthhqgUlgORzb53mk+To=' 
WHERE 
  key_id = '233e6b4644af0a4c6efa7d92030a4ddb6a09bde66060b3fc37605def61fbf0b7' 
  AND (
    token = 'bsusKzEZLNujvpkrwGHv3nRcthhqgUlgORzb53mk+To=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00028