UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'yaZK+VLp4GK8xf/Au6z3OFiWSy622Hkxau6JZ0+nnwY=' 
WHERE 
  key_id = '98a9344b7867f685a3bc7a571765589264ea5f61257b68ee2c64034e8da97d41' 
  AND (
    token = 'yaZK+VLp4GK8xf/Au6z3OFiWSy622Hkxau6JZ0+nnwY=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00026