UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'tlxJrKpBPQGTeoij1YoAmvmi9E7k6qYRY8g12AoBV/o=' 
WHERE 
  key_id = '20d18f96d1ce46a212849f9138331e8c723124d4924a41cbdbbb055ec6fe0a0a' 
  AND (
    token = 'tlxJrKpBPQGTeoij1YoAmvmi9E7k6qYRY8g12AoBV/o=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00024