UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'BKFS0gWy3oIRuknoYSt86Jq+iWVEii6y7M4S6wBdXkk=' 
WHERE 
  key_id = 'e33222910b58c1335cc4b013d50d1342c37b8b6d88a382e0967755c458759f27' 
  AND (
    token = 'BKFS0gWy3oIRuknoYSt86Jq+iWVEii6y7M4S6wBdXkk=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00033