UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'e7Km5JO75mOLItCFG8ufkJunJ89AJ34bNvL+1gKlLjE=' 
WHERE 
  key_id = '977a539691c41b1a87dc8c5774703838746f53eb11201ef3e5656caaac1615f3' 
  AND (
    token = 'e7Km5JO75mOLItCFG8ufkJunJ89AJ34bNvL+1gKlLjE=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00066