UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '1Dg/hcOekxOuRyF7WnS33CR//L5QXfONLdAAN2tIqyc=' 
WHERE 
  key_id = 'fb4057c595d6ead647c9b93c0a146feed8f8c7b6957f3412b1d111568f3cff23' 
  AND (
    token = '1Dg/hcOekxOuRyF7WnS33CR//L5QXfONLdAAN2tIqyc=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00022