UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'tQBfmeXwRABHTxcRkAo8TygoJVmg2zoXVmb6QZlyL4g=' 
WHERE 
  key_id = '61570f8e7645f0493bb8b466fbd34468ac3b5fc845c9ddc09460abd2574fae3c' 
  AND (
    token = 'tQBfmeXwRABHTxcRkAo8TygoJVmg2zoXVmb6QZlyL4g=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00016