UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'pwLkzrfRSPpmR/M3d50R7yMFqB93UDUqb48dtVAT26U=' 
WHERE 
  key_id = '8afce7235355461e4854bb07e61b01e9c2df106c76206d43b1e3cfe79ed78ecc' 
  AND (
    token = 'pwLkzrfRSPpmR/M3d50R7yMFqB93UDUqb48dtVAT26U=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00026