UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '7lurtFdCJmmReM7dRJsj9v0J8aiZXW7eH3suYOdNiqA=' 
WHERE 
  key_id = '071b1d99ee4bf5f9fc0219c8f9a419d0f40f7560bcd215900b13ad3044a4c499' 
  AND (
    token = '7lurtFdCJmmReM7dRJsj9v0J8aiZXW7eH3suYOdNiqA=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00023