UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '9Eqe8dvNvayCXjPSuAFAb+PgnE4xXbpYIJOMFCumZgI=' 
WHERE 
  key_id = '7323f1a5fa04fcca72549c224f3314fba89cb047762ad61dd7064910d5904d59' 
  AND (
    token = '9Eqe8dvNvayCXjPSuAFAb+PgnE4xXbpYIJOMFCumZgI=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00028