UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'QdDB9wDVuAy8ob8cBsLhTbnl9Q3ihEVqZhoo2DRoOv8=' 
WHERE 
  key_id = '452a63879ee97e6cee65274e1e07cba44fa04e09c825b818e647207ed84cad4c' 
  AND (
    token = 'QdDB9wDVuAy8ob8cBsLhTbnl9Q3ihEVqZhoo2DRoOv8=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00019