UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'VaPkDKQPPh9YGRBHx55njYjEAfuC1zyrtitBvCHg7LQ=' 
WHERE 
  key_id = '3fc7ac762afca0da34ed7bd410135e24ca31f1d343b513d53e84f3aed62bacab' 
  AND (
    token = 'VaPkDKQPPh9YGRBHx55njYjEAfuC1zyrtitBvCHg7LQ=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00029